_onHoverChange: function(actor) {
let hover = this.actor.hover;
if (!hover) {
- if (this.actor.pressed && this._dragStartX != null) {
+ if (this.actor.held && this._dragStartX != null) {
this.actor.fake_release();
this._draggable.startDrag(this._dragStartX, this._dragStartY,
global.get_current_time());
_onHoverChanged: function(button) {
let hover = button.hover;
if (!hover) {
- if (button.pressed && this._dragStartX != null) {
+ if (button.held && this._dragStartX != null) {
button.fake_release();
this._draggable.startDrag(this._dragStartX, this._dragStartY,
global.get_current_time());
PROP_0,
PROP_ACTIVE,
- PROP_PRESSED,
+ PROP_HELD,
+ PROP_PRESSED
};
static guint st_clickable_signals [LAST_SIGNAL] = { 0 };
case PROP_ACTIVE:
g_value_set_boolean (value, self->priv->active);
break;
+ case PROP_HELD:
+ g_value_set_boolean (value, self->priv->held);
+ break;
case PROP_PRESSED:
g_value_set_boolean (value, self->priv->pressed);
break;
FALSE,
G_PARAM_READWRITE));
+ /**
+ * StClickable:held
+ *
+ * This property tracks whether the button has the pointer grabbed,
+ * whether or not the pointer is currently hovering over the button.
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_HELD,
+ g_param_spec_boolean ("held",
+ "Held state",
+ "Whether the mouse button is currently pressed",
+ FALSE,
+ G_PARAM_READABLE));
+
/**
* StClickable:pressed
*